{% extends 'learn_app/base.html' %}
{% block header %}
添加一个新主题
{% endblock %}

{% block content %}
<form method="post" enctype="multipart/form-data" action="">
    {% csrf_token %}
    {{form.as_p}}
    {% if form.errors %}
        <div class="alert alert-danger">
            {% for field in form %}
                {% for error in field.errors %}
                    {{field.label}}:{{error}}
                {% endfor %}
            {% endfor %}
        </div>
    {% endif %}
    <button type="submit" class="btn btn-primary" id="">保存新建主题</button>
</form>
<a href="{% url 'learn_app:topics' %}" class="btn btn-secondary ms-2">返回主题页面</a>
{% endblock %}